#ifndef __IGU_TRAJ__
#define __IGU_TRAJ__

#include <iostream>

#include "Vec2.h"

class Trajectory
{
public:
	public:
	// Constructor (initializes the figure)
	Trajectory();

	// Renders the figure with OpenGL
	void renderTrajectory() const;
	

	// Updates the next vertex
	void updateNextVertex(const Vec2& nueva_posicion);

	// Adds the current vertex (_nextVertex) to the figure
	void addNextVertex();

	// Returns the num-th vertex
	const Vec2& vertex(unsigned int num) const;

	// Returns the number of vertices
	unsigned int nVertices() const;

	// Save the figure. 
	void save( std::ostream& output);

	// Loads the figure. 
	int load( std::istream& input);

	void cambiarColor(float r, float g, float b);

		// Deletes the Last vertex of the trajectory
	void deleteLastVertex();
	void deleteRewrite();
	Vec2 auxiliar;


	Vec2 _nextVertex; // Next vertex to be added
	VectorVec2 _vertices; // Vector of vertices in the figure
private:
	float red;
	float green;
	float blue;
	int trajtam;
};


#endif

